package practice;

public class Text03 {
    public static void main(String[] args) {
        StringBuilder sb=new StringBuilder("车臣恐怖分子计划利用爆炸摧毁政府的军火库。");
        String a="恐怖";
        String b="爆炸";
        String c="军火";
        while (true){
            int num;
            if((num=sb.indexOf(a))!=-1){
                sb=sb.delete(num,num+2);
            }else if((num=sb.indexOf(b))!=-1){
                sb=sb.delete(num,num+2);
            }else if ((num=sb.indexOf(c))!=-1){
                sb=sb.delete(num,num+2);
            }else {
                break;
            }
        }
        System.out.println(sb);
    }
}
